private ["_idxs","_i","_idx"];
_idx = - 1;
if !(isNil "headlessClients") then {
	_idxs = [];
	for "_i" from 0 to (count headlessClients - 1) do {
		if !(isNull(headlessClients select _i)) then {
			_idxs set [count _idxs, _i];
		};
	};
	if (count _idxs > 0) then {
		_idx = _idxs select (floor(random(count _idxs)));
	};
};
diag_log ["MSO GetHC",_idx];
_idx;